<include file="public/min-header" />
<link href="__PUBLIC__/plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<script src="__PUBLIC__/plugins/daterangepicker/moment.min.js" type="text/javascript"></script>
<script src="__PUBLIC__/plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<div class="wrapper">
  <include file="public/breadcrumb"/>
  <section class="content ">
    <!-- Main content -->
    <div class="container-fluid">
      <div class="pull-right">
        <a href="javascript:history.go(-1)" data-toggle="tooltip" title="" class="btn btn-default" data-original-title="返回管理员列表"><i class="fa fa-reply"></i></a>
      </div>
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 添加管理员</h3>
        </div>
        <div class="panel-body ">
          <!--表单数据-->
          <form method="post" id="adminHandle" action="{:U('User/adminHandle')}">
            <!--通用信息-->
            <div class="tab-content col-md-10">
              <div class="tab-pane active" id="tab_tongyong">
                <table class="table table-bordered">
                  <tbody>
                  <tr>
                    <td class="col-sm-2">用户名：</td>
                    <td class="col-sm-8">
                      <input type="text" class="form-control" name="user_name" value="{$info.user_name}" >

                    </td>
                  </tr>
                  <tr>
                    <td>昵称：</td>
                    <td >
                      <input type="text" class="form-control" name="nickname" value="{$info.nickname}" >

                    </td>
                  </tr>
                  <tr>
                    <td>登陆密码：</td>
                    <td>
                      <input type="password" class="form-control" name="password" value="{$info.password}" >
                    </td>
                  </tr>

                    <tr>
                      <td>所属角色：</td>
                      <td>
                        <select name="role">
                            <option value="1" <if condition="$info.role eq 1"> selected="selected"</if>>经理</option>
                            <option value="2" <if condition="$info.role eq 2"> selected="selected"</if>>销售</option>
                        </select>
                      </td>
                    </tr>

                  <tr>
                    <td><span style="color:#F00;">*</span>头像：</td>
                    <td class="col-sm-8">
                      <div class="col-sm-4">
                        <input type="text" class="form-control" style="width:350px;margin-left:-15px;" name="imges" value="{$info.imges}" id="imges" >
                      </div>
                      <div class="col-sm-4">
                        <input type="button" class="btn btn-default" onClick="GetUploadify(1,'imges','imges','')"  value="上传头像图"/>
                      </div>
                    </td>
                  </tr>

                  </tbody>
                  <tfoot>
                  <tr>
                    <td><input type="hidden" name="act" value="{$act}">
                      <input type="hidden" name="user_admin_id" value="{$info.user_admin_id}">
                    </td>
                    <td class="text-right"><input class="btn btn-primary" type="button" onclick="adsubmit()" value="保存"></td></tr>
                  </tfoot>
                </table>
              </div>
            </div>
          </form><!--表单数据-->
        </div>
      </div>
    </div>
  </section>
</div>
<script>
  function adsubmit(){

    if($('input[name=user_name]').val() == ''){
      layer.msg('用户名不能为空！', {icon: 2,time: 1000});
      return false;
    }
    // if(!checkPhone($('input[name=email]').val())){
    //   layer.msg('手机号不能为空或不正确！', {icon: 2,time: 1000});
    //   return false;
    // }
    if($('input[name=password]').val() == '' && '{$act}' == 'add'){
      layer.msg('密码不能为空！', {icon: 2,time: 1000});
      return false;
    }
    $('#adminHandle').submit();
  }
</script>
</body>
</html>